libvirt: Fix missing libvirt-python
PATCH v2 1/1 libvirt: Fix missing libvirt-python
From: Tom Hochstein <[email protected]>
The do_rootfs task for an image that includes libvirt-python fails.
``` - nothing provides libvirt-python needed by packagegroup-fsl-virtualization-1.0-r0.ls1012afrwy from oe-repo ```
The log shows that the do_compile:append() from libvirt-python.inc is failing but not reporting the failure.
``` 174: cd: can't cd to /.../libvirt/v11.8.0+git/sources/libvirt-v11.8.0+git/libvirt-python-11.8.0 ```
The root cause is the archive folder format is changed from libvirt-python-VERSION to libvirt_python-VERSION, but the do_compile and do_install tasks are hard-coded to the old format.
Fix the root cause by encoding the archive folder name in a common variable. Also, fix the build and install commands so the cd failure is not ignored.
--- recipes-extended/libvirt/libvirt-python.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +7 -7
@@ -18,8 +18,8 @@ FILES:${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" # Currently the libvirt-python debug libraries contain buildpaths INSANE_SKIP:${PN}-dbg += "buildpaths" -SRC_URI += "http://libvirt.org/sources/python/${BPN}_python-${LIBVIRT_VERSION}.tar.gz;name=libvirt_python;subdir=${BP}" - +SRC_URI += "http://libvirt.org/sources/python/${LIBVIRT_PYTHON_ARCHIVE_NAME}.tar.gz;name=libvirt_python;subdir=${BP}" +LIBVIRT_PYTHON_ARCHIVE_NAME = "${BPN}_python-${LIBVIRT_VERSION}" SRC_URI[libvirt_python.sha256sum] = "5d80e13e0cfb96dd254d765ee60e77e5f9b6925172540056cec0aa0e6f0ca83c" export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml"
@@ -46,8 +46,8 @@ do_compile:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build + cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME} + ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build cd - fi }
@@ -58,9 +58,9 @@ do_install:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ - --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} + cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME} + ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ + --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} cd - fi }
Signature · 1 line
2.34.1
Quoted 71 lines · Tom Hochstein via lists.yoctoproject.org
From: Tom Hochstein <[email protected]>
The
do_rootfstask for an image that includes libvirt-python fails.``` - nothing provides libvirt-python needed by packagegroup-fsl-virtualization-1.0-r0.ls1012afrwy from oe-repo ```The log shows that the do_compile:append() from libvirt-python.inc is failing but not reporting the failure.
``` 174: cd: can't cd to /.../libvirt/v11.8.0+git/sources/libvirt-v11.8.0+git/libvirt-python-11.8.0 ```The root cause is the archive folder format is changed from libvirt-python-VERSION to libvirt_python-VERSION, but the
do_compileanddo_installtasks are hard-coded to the old format.Fix the root cause by encoding the archive folder name in a common variable. Also, fix the build and install commands so the cd failure is not ignored.
Signed-off-by Tom Hochstein <[email protected]>--- recipes-extended/libvirt/libvirt-python.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -18,8 +18,8 @@ FILES:${PN}-python = "${bindir}/* ${libdir}/*${libdir}/${PYTHON_DIR}/*"
# Currently the libvirt-python debug libraries contain buildpaths INSANE_SKIP:${PN}-dbg += "buildpaths"-SRC_URI += "
http://libvirt.org/sources/python/${BPN}_python-${LIBVIRT_VERSION}.tar.gz;name=libvirt_python;subdir=${BP}
"recipes-extended/libvirt/libvirt-python.inc +1
-1- +SRC_URI += "http://libvirt.org/sources/python/${LIBVIRT_PYTHON_ARCHIVE_NAME}.tar.gz;name=libvirt_python;subdir=${BP}
"
+LIBVIRT_PYTHON_ARCHIVE_NAME = "${BPN}_python-${LIBVIRT_VERSION}"
SRC_URI[libvirt_python.sha256sum] =
"5d80e13e0cfb96dd254d765ee60e77e5f9b6925172540056cec0aa0e6f0ca83c"export
LIBVIRT_API_PATH= "${S}/docs/libvirt-api.xml"recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -46,8 +46,8 @@ do_compile:append() { # the syroot staged pkgconfig entries. So we clear thesysroot
# for just this portion. export PKG_CONFIG_SYSROOT_DIR=recipes-extended/libvirt/libvirt-python.inc +0
-2- cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.pybuild
recipes-extended/libvirt/libvirt-python.inc +2
-0+ cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME} + ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.pybuild
cd -
fi
}recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -58,9 +58,9 @@ do_install:append() { # the syroot staged pkgconfig entries. So we clear thesysroot
# for just this portion. export PKG_CONFIG_SYSROOT_DIR=recipes-extended/libvirt/libvirt-python.inc +0
-2- cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py
Quoted 5 lines
install \
- --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR}
${LIBVIRT_INSTALL_ARGS}
+ cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME}
As I hinted at in my other reply just a minute ago, I'd actually prefer that if we are
changing this to fail on the directory not existing (which really has only happened
once in the decade or so this exists), then we should put a test for the directory
and output a clearer error message. Otherwise, someone getting that failed cd will have no idea why it happened.
Bruce
Quoted 22 lines
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3
setup.py
install \
+ --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR}
${LIBVIRT_INSTALL_ARGS}
cd -
fi
}
--
2.34.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#9429):
https://lists.yoctoproject.org/g/meta-virtualization/message/9429
Mute This Topic: https://lists.yoctoproject.org/mt/116152179/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 86 lines · Bruce Ashfield
You don't often get email from [email protected]. Learn why this is important <https://aka.ms/LearnAboutSenderIdentification>
On Thu, Nov 6, 2025 at 8:15 AM Tom Hochstein via lists.yoctoproject.org <http://lists.yoctoproject.org> <[email protected]> wrote:
From: Tom Hochstein <[email protected]> The do_rootfs task for an image that includes libvirt-python fails. ``` - nothing provides libvirt-python needed by packagegroup-fsl-virtualization-1.0-r0.ls1012afrwy from oe-repo ``` The log shows that the do_compile:append() from libvirt-python.inc is failing but not reporting the failure. ``` 174: cd: can't cd to /.../libvirt/v11.8.0+git/sources/libvirt-v11.8.0+git/libvirt-python-11.8.0 ``` The root cause is the archive folder format is changed from libvirt-python-VERSION to libvirt_python-VERSION, but the do_compile and do_install tasks are hard-coded to the old format. Fix the root cause by encoding the archive folder name in a common variable. Also, fix the build and install commands so the cd failure is not ignored. Signed-off-by: Tom Hochstein <[email protected]> --- recipes-extended/libvirt/libvirt-python.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc index c430ffe5..0a99296a 100644 --- a/recipes-extended/libvirt/libvirt-python.inc +++ b/recipes-extended/libvirt/libvirt-python.inc @@ -18,8 +18,8 @@ FILES:${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" # Currently the libvirt-python debug libraries contain buildpaths INSANE_SKIP:${PN}-dbg += "buildpaths" -SRC_URI += "http://libvirt.org/sources/python/${BPN}_python-${LIBVIRT_VERSION}.tar.gz;name=libvirt_python;subdir=${BP} <http://libvirt.org/sources/python/$%7BBPN%7D_python-$%7BLIBVIRT_VERSION%7D.tar.gz;name=libvirt_python;subdir=$%7BBP%7D>" - +SRC_URI += "http://libvirt.org/sources/python/${LIBVIRT_PYTHON_ARCHIVE_NAME}.tar.gz;name=libvirt_python;subdir=${BP} <http://libvirt.org/sources/python/$%7BLIBVIRT_PYTHON_ARCHIVE_NAME%7D.tar.gz;name=libvirt_python;subdir=$%7BBP%7D>" +LIBVIRT_PYTHON_ARCHIVE_NAME = "${BPN}_python-${LIBVIRT_VERSION}" SRC_URI[libvirt_python.sha256sum] = "5d80e13e0cfb96dd254d765ee60e77e5f9b6925172540056cec0aa0e6f0ca83c" export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" @@ -46,8 +46,8 @@ do_compile:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build + cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME} + ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build cd - fi } @@ -58,9 +58,9 @@ do_install:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ - --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} + cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME}
Quoted 7 lines
As I hinted at in my other reply just a minute ago, I'd actually prefer that if we are changing this to fail on the directory not existing (which really has only happened once in the decade or so this exists), then we should put a test for the directory and output a clearer error message. Otherwise, someone getting that failed cd will have no idea why it happened.
Bruce
I think it's good to keep exceptional logic to a minimum. We might not ever see this failure again. Plus, I'd argue that failing on the cd command gives a straightforward clue for how to debug. Let me know if you disagree, and I'll add the logic as you request.
Tom
Quoted 30 lines
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ + --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} cd - fi } -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#9429): https://lists.yoctoproject.org/g/meta-virtualization/message/9429 Mute This Topic: https://lists.yoctoproject.org/mt/116152179/1050810 Group Owner: [email protected] <mailto:meta-virtualization%[email protected]> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 100 lines · Tom Hochstein
On 11/6/2025 8:18 AM, Bruce Ashfield wrote:
You don't often get email from [email protected]. Learn why this is important <https://aka.ms/LearnAboutSenderIdentification>
Quoted 68 lines · Tom Hochstein via lists.yoctoproject.org
From: Tom Hochstein <[email protected]>
The
do_rootfstask for an image that includes libvirt-python fails.``` - nothing provides libvirt-python needed by packagegroup-fsl-virtualization-1.0-r0.ls1012afrwy from oe-repo ```The log shows that the do_compile:append() from libvirt-python.inc is failing but not reporting the failure.
``` 174: cd: can't cd to /.../libvirt/v11.8.0+git/sources/libvirt-v11.8.0+git/libvirt-python-11.8.0 ```The root cause is the archive folder format is changed from libvirt-python-VERSION to libvirt_python-VERSION, but the
do_compileanddo_installtasks are hard-coded to the old format.Fix the root cause by encoding the archive folder name in a common variable. Also, fix the build and install commands so the cd failure is not ignored.
Signed-off-by Tom Hochstein <[email protected]>--- recipes-extended/libvirt/libvirt-python.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -18,8 +18,8 @@ FILES:${PN}-python = "${bindir}/* ${libdir}/*${libdir}/${PYTHON_DIR}/*"
# Currently the libvirt-python debug libraries contain buildpaths INSANE_SKIP:${PN}-dbg += "buildpaths"-SRC_URI += "
http://libvirt.org/sources/python/${BPN}_python-${LIBVIRT_VERSION}.tar.gz;name=libvirt_python;subdir=${BP}
"recipes-extended/libvirt/libvirt-python.inc +1
-1- +SRC_URI += "http://libvirt.org/sources/python/${LIBVIRT_PYTHON_ARCHIVE_NAME}.tar.gz;name=libvirt_python;subdir=${BP}
"
+LIBVIRT_PYTHON_ARCHIVE_NAME = "${BPN}_python-${LIBVIRT_VERSION}"
SRC_URI[libvirt_python.sha256sum] =
"5d80e13e0cfb96dd254d765ee60e77e5f9b6925172540056cec0aa0e6f0ca83c"export
LIBVIRT_API_PATH= "${S}/docs/libvirt-api.xml"recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -46,8 +46,8 @@ do_compile:append() { # the syroot staged pkgconfig entries. So we clear thesysroot
# for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py buildrecipes-extended/libvirt/libvirt-python.inc +2
-0+ cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME} + ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.pybuild
cd -
fi
}recipes-extended/libvirt/libvirt-python.inc +0
-0@@ -58,9 +58,9 @@ do_install:append() { # the syroot staged pkgconfig entries. So we clear thesysroot
Quoted 10 lines
# for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ - ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ - --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} + cd ${UNPACKDIR}/${BP}/${LIBVIRT_PYTHON_ARCHIVE_NAME}As I hinted at in my other reply just a minute ago, I'd actually prefer that if we are
changing this to fail on the directory not existing (which really has only happened
once in the decade or so this exists), then we should put a test for the directory
and output a clearer error message. Otherwise, someone getting that failed cd will have no idea why it happened.
Quoted 9 lines
Bruce
I think it's good to keep exceptional logic to a minimum. We might not ever see this failure again. Plus, I'd argue that failing on the cd command gives a straightforward clue for how to debug. Let me know if you disagree, and I'll add the logic as you request.
Tom
I'll insist on this one, since I completely disagree on a failed cd to what will appear to be an arcane and magic directory is useful to any end user.
Bruce
Quoted 32 lines
Quoted 14 lines
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3
setup.py
install \
+ --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR}
${LIBVIRT_INSTALL_ARGS}
cd -
fi
}
--
2.34.1Quoted 11 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#9429):
https://lists.yoctoproject.org/g/meta-virtualization/message/9429
Mute This Topic: https://lists.yoctoproject.org/mt/116152179/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=---
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II